<?php
/**
 * The main template file.
 * @package WOODGIFT
 * @author Mr Rony<mrtrandangtrinh@gmail.com>
 */
get_header(); 
?>
<div class="main-content row">
	<div class="col-md-9 main-fix list-product">
		<ul class="products clearfix">
			<?php query_posts("orderby=DESC&post_type=product&post_status=publish&showposts=12"); ?>
			<?php $loop = 0; ?>
			<?php global $product; ?>
			<?php while (have_posts()) : the_post(); ?>
			<?php $sText = ( 0 === ($loop % 3) ) ? ' item-loop' : ''; ?>
			<li class="product<?php echo $sText; ?>">
				<?php $loop++; ?>
				<a class="item" href="<?php the_permalink(); ?>">
					<?php if (has_post_thumbnail()) : ?>
							<?php the_post_thumbnail('thumb-products'); ?>
						<?php endif; ?>
					<h3><?php the_title(); ?></h3>
                    <h4 class="price"><?php echo number_format($product->get_price(), 0, '.' , '.'); ?>.000 VNĐ</h4>
					<span class="detail"><?php _e("Xem chi tiết"); ?></span>
				</a>
			</li>
			<?php endwhile; ?>
			<?php wp_reset_query(); ?>
            <li style="clear: both; text-align: right;"><a href="<?php echo get_permalink(63); ?>">Xem thêm sản phẩm &rarr;</a></li>
		</ul>
	</div>
	<?php get_sidebar(); ?>
</div>
<?php 
get_footer();
?>